package domain.penum;

/**
 * 
* @ClassName: DecorationEnum 
* @Description: 装修枚举
* @author chenchao
* @date 2014年1月16日 下午12:45:47 
*
 */
public enum DecorationEnum {
	UNKON("不限",-1), NO("毛坯",1),LOW("简单装修",2), MIDDLE("中等装修",3),ADVANCE("精装修 ",4),SUPPER("豪华装修",5);
	
    // 成员变量  
    private String name;  
    private int index; 
    /**
     * 
    * <p>Title: </p> 
    * <p>Description: </p> 
    * @param name
    * @param index
     */
	private   DecorationEnum(String name,int index) {
		this.name = name;
		this.index = index;
	}
	
	
	// 普通方法  
	public static String getName(int index) {  
        for (DecorationEnum c : DecorationEnum.values()) {  
            if (c.getIndex() == index) {  
                return c.name;  
            }  
        }  
        return null;  
    }  
	
	
	public static int getIndex(String name) {
		for (DecorationEnum c : DecorationEnum.values()) {  
			if (c.getName().equals(name)) {
				return c.index;
			}
		}
		return  -1;
	}
	
    public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public int getIndex() {
		return index;
	}


	public void setIndex(int index) {
		this.index = index;
	}

	
}
